using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class WaybillGoodsDetailMap : EntityTypeConfiguration<WaybillGoodsDetail>
	{
		public WaybillGoodsDetailMap()
		{
			// Primary Key
			this.HasKey(t => t.WayBillGoodsID);

			// Properties
			this.Property(t => t.GoodsCode)
				.HasMaxLength(100);
				
			this.Property(t => t.GoodsName)
				.HasMaxLength(200);
				
			this.Property(t => t.Size)
				.HasMaxLength(100);
				
			this.Property(t => t.Remark)
				.HasMaxLength(200);
				
			this.Property(t => t.Unit)
				.HasMaxLength(100);
				
			this.Property(t => t.ReasonID)
				.HasMaxLength(4);
				
			// Table & Column Mappings
			this.ToTable("WaybillGoodsDetails");
			this.Property(t => t.WayBillGoodsID).HasColumnName("WayBillGoodsID");
			this.Property(t => t.WayBillNO).HasColumnName("WayBillNO");
			this.Property(t => t.GoodsCode).HasColumnName("GoodsCode");
			this.Property(t => t.GoodsName).HasColumnName("GoodsName");
			this.Property(t => t.Size).HasColumnName("Size");
			this.Property(t => t.Remark).HasColumnName("Remark");
			this.Property(t => t.Unit).HasColumnName("Unit");
			this.Property(t => t.Num).HasColumnName("Num");
			this.Property(t => t.Price).HasColumnName("Price");
			this.Property(t => t.Amount).HasColumnName("Amount");
			this.Property(t => t.Volume).HasColumnName("Volume");
			this.Property(t => t.Weight).HasColumnName("Weight");
			this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatStation).HasColumnName("CreatStation");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateStation).HasColumnName("UpdateStation");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.ReasonID).HasColumnName("ReasonID");
		}
	}
}

